import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


function getTitle() {
  let defaultTitle = "";
  if (localStorage.getItem("title")) {
    defaultTitle = localStorage.getItem("title")
  }
  return defaultTitle
}
export default new Vuex.Store({
  state: {
    title: getTitle()
  },
  mutations: {
    changeTitle(state, title) {
      state.title = title;
      localStorage.setItem("title", title)
    }
  },
  actions: {
  },
  modules: {
  }
})
